<template>
	<view class="container page-background">
		
		<custom-nav-bar title="分类"></custom-nav-bar>
		
		<view class="classify">
			<theme-item v-for="item in classList" :key="item._id"
			:item="item"
			>
				
			</theme-item>
		</view>
		
	</view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { apiGetClassList } from '@/api/apis'
import {onShareAppMessage, onShareTimeline} from '@dcloudio/uni-app'

	onLoad(() => {
		getClassList()
	})
	const classList = ref([])
	const getClassList = async () => {
		const res = await apiGetClassList({pageSize: 15})
		classList.value = res.data
	}
	
	// 分享给好友
	onShareAppMessage(e => {
		return {
			title: '咸虾米壁纸，精选分类',
			path: 'pages/classify/classify'
		}
	}) 
	
	// 分享到朋友圈
	onShareTimeline(() => {
		return {
			title: '咸虾米壁纸, 精选分类',
		}
	})
	
	// 分享到朋友圈
	onShareTimeline(() => {
		return {
			title: '咸虾米壁纸~~~'
		}
	})
</script>

<style lang="scss" scoped>
.container {
	.classify {
		padding: 30rpx;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 15rpx;// 列之间的空隙
	}
}
</style>
